#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;

const int N = 1e6 + 10;
int a[N], c[N];
int la, lc;
int b; 
void sub()
{
	long long int t = 0;
	for (int i = la - 1; i >= 0; i--)
	{
		t = t * 10 + a[i];
		c[i] = t / b;
		t %= b;
	}
	while (lc > 1 && !c[lc - 1]) lc--;
}
int main()
{
	string s; cin >> s;
	cin >> b;
	la = s.size(); lc = la; 
	for (int i = 0; i < s.size(); i++) a[la - i - 1] = s[i] - '0';

	sub();

	for (int i = lc - 1; i >= 0; i-- ) cout << c[i];

	return 0;
}